var api = require('../../../util/api.js');
Page({
  data: {

  },
  onLoad() {
    var _this = this;
    _this.setData({
      page: api.page(20),
      dataList: [],
      params: {
        examineId: api.chain().examineId
      },
      examineName: api.chain().examineName
    });
    _this.onReachBottom();
  },
  onReachBottom() {
    this.loadList();
  },
  loadList() {
    var _this = this;
    var params = _this.data.params;
    var page = _this.data.page;
    api.get(api.url.ljjd.totalList, params, page).then(res => {
      page.setTotal(res.total);
      if (res.rows.length == 0) {
        this.setData({
          hasData: false
        })
      } else {
        _this.setData({
          hasData: true,
          dataList: _this.data.dataList.concat(res.rows)
        });
      }
    })
  },
  toMark: function (e) {
    api.chain({
      userId: e.currentTarget.dataset.userId
    });
    wx.navigateTo({
      url: `../../examine_item/score`
    });
  }
})